#pragma once
#include <D2d1helper.h>
#include "d3dx11effect.h"



// BGRA
#define BGR(b, g, r)		( (DWORD)(b) | (DWORD)(g) << 8 | (DWORD)(r) << 16 )
#define BGRA(b, g, r, a)	( (DWORD)(b) | (DWORD)(g) << 8 | (DWORD)(r) << 16 | (DWORD)(a) << 24 )

//radian
#define radian(x) ((x) * XM_PI / 180.0f)

// COM_SAFE_RELEASE
#define COM_SAFE_RELEASE(obj) ComSafeRelease((IUnknown *&)obj)
void ComSafeRelease(IUnknown *&pObj);

// xRectF
struct xRectF : public D2D1_RECT_F
{
	xRectF	&operator = (const RECT &rect);
	void	OffsetRect(FLOAT x, FLOAT y);
};

// type
typedef ID2D1SolidColorBrush xBrush;
typedef ID2D1Bitmap xBitmap;
typedef ID2D1BitmapRenderTarget xBitmapRenderTarget;
typedef ID2D1RenderTarget xRenderTarget;
typedef ID2D1SolidColorBrush xBrush;
typedef IDWriteTextFormat xFont;

typedef ID3DX11Effect xEffect;
typedef ID3DX11EffectTechnique xTechnique;
typedef ID3D11ShaderResourceView xShaderResource;
typedef ID3D11Resource xResource;
typedef ID3D11InputLayout xInputLayout;
typedef ID3D11Buffer xBuffer;
typedef ID3D11RenderTargetView xRenderView;
typedef D3D11_INPUT_ELEMENT_DESC XINPUT_ELEMENT_DESC;